﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 招聘网站
{
    public partial class Form7 : Form
    {
        public Form7()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string SqlStr = "server=.;database=zhaopin;integrated security=SSPI";
            SqlConnection con = new SqlConnection(SqlStr);
            con.Open();
            SqlCommand comm = new SqlCommand();
            comm.Connection = con;
            comm.CommandText = "insert into table_4(jianli) values( '" + textBox1.Text + "')";
            if (comm.ExecuteNonQuery() > 0)
            {
                MessageBox.Show("添加成功", "正确", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                Form5 f5 = new Form5();
                f5.Show();
                this.Hide();
            }
            else
                MessageBox.Show("未添加成功，请重新输入！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            textBox1.Clear();
            textBox1.Focus();
        }


        private void Form7_Load(object sender, EventArgs e)
        {

        }
    }
}
